#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : Book.py
# @Author: Xuhao
# @Date  : 2018/3/16
# @Desc  :


from flask_restful import Resource
from flask import request
from flask_restful import reqparse, abort
from flask import jsonify
import json

configDict = { "biqugeso":{ "detail" :{"bookname":"//h1[@class='bookTitle']"},

                            "chapter": { "chapterItemxpath":"//div[@class='panel-body panel-chapterlist']//dd[@class='col-md-3']",
                                    "chapterurlxpath":"//a",
                                    "chapterNamexpath":"href" },

                            "content":{}

                       },
                "suimeng":{"detail" :{"bookname":"//h2[@class='ratitle']"},
                            "chapter": { "chapterItemxpath":"//div[@class='mread row']//table[@class='acss']//td[@class='ccss']",
                                    "chapterurlxpath":"href",
                                    "chapterNamexpath":"//a" },
                            "content":{}
                       }

             }



class BookXpath(Resource):
    def get(self):

        return jsonify({"message": "获取成功",
                        "error_code": 0,
                        "data": configDict}
                       )


class BookDetailXpath(Resource):

    def get(self):
        pass


class BookChpaterXpath(Resource):

    def get(self):
        pass


class BookContentXpath(Resource):

    def get(self):
        pass